Skip to content

Implemented a fallback parameter validation for DbClusterParameterGroup #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rushmash91
Copy link
Member

fixes aws-controllers-k8s/community#1847

DbClusterParameterGroup was incorrectly rejecting valid parameters like slow_query_log, long_query_time, and log_queries_not_using_indexes with "unknown parameter" errors. This occurred because the controller only validated parameters against DescribeEngineDefaultClusterParameters API, but some valid cluster parameters (particularly MySQL logging parameters) are only listed in the DescribeEngineDefaultParameters (instance-level) API response.

Description of changes:

Implemented a fallback parameter validation mechanism in getParameterMeta() that first checks cluster-level parameter defaults, and if not found, falls back to instance-level parameter defaults before rejecting a parameter as unknown. This allows the controller to properly validate and apply parameters that AWS RDS Console and CLI support but weren't previously accessible through the ACK controller, while maintaining backward compatibility and proper parameter metadata handling for apply methods and modifiability checks.

apiVersion: rds.services.k8s.aws/v1alpha1
kind: DBClusterParameterGroup
metadata:
  name: test-slow-query-log
spec:
  name: test-slow-query-log
  description: Test parameter group to reproduce slow_query_log issue
  family: "aurora-mysql8.0"
  parameterOverrides:
    slow_query_log: "1"
    long_query_time: "10"
    log_queries_not_using_indexes: "1"
{"level":"debug","ts":"2025-07-21T14:41:49.089-0700","logger":"ackrt","msg":"patched resource status","kind":"DBClusterParameterGroup","namespace":"default","name":"test-slow-query-log","account":"xxx","role":"","region":"us-west-2","is_adopted":false,"generation":1,"json":"{\"metadata\":{\"resourceVersion\":\"103993920\"},\"spec\":{\"tags\":null},\"status\":{\"ackResourceMetadata\":{\"arn\":\"arn:aws:rds:us-west-2:xxxx:cluster-pg:test-slow-query-log\",\"ownerAccountID\":\"xxxx\",\"region\":\"us-west-2\"},\"conditions\":[{\"lastTransitionTime\":\"2025-07-21T21:41:49Z\",\"message\":\"Resource synced successfully\",\"reason\":\"\",\"status\":\"True\",\"type\":\"ACK.ResourceSynced\"}],\"parameterOverrideStatuses\":[{\"applyMethod\":\"immediate\",\"applyType\":\"dynamic\",\"parameterName\":\"log_queries_not_using_indexes\",\"parameterValue\":\"1\"},{\"applyMethod\":\"immediate\",\"applyType\":\"dynamic\",\"parameterName\":\"long_query_time\",\"parameterValue\":\"10\"},{\"applyMethod\":\"immediate\",\"applyType\":\"dynamic\",\"parameterName\":\"slow_query_log\",\"parameterValue\":\"1\"}]}}"}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from jlbutler and michaelhtm July 21, 2025 22:22
@ack-prow ack-prow bot added the approved label Jul 21, 2025
Copy link
Contributor

@knottnt knottnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, but could we add a test to verify the behavior?

@rushmash91 rushmash91 changed the title parameters fix Implemented a fallback parameter validation for DbClusterParameterGroup Jul 22, 2025
@rushmash91 rushmash91 force-pushed the dbClusterParameterGroup branch 7 times, most recently from cbe2a4b to 5575e8b Compare July 23, 2025 00:55
@rushmash91
Copy link
Member Author

/test rds-kind-e2e

@rushmash91 rushmash91 force-pushed the dbClusterParameterGroup branch 4 times, most recently from d71217e to 0f598f0 Compare July 24, 2025 06:07
@rushmash91 rushmash91 force-pushed the dbClusterParameterGroup branch from 0f598f0 to c7c7d15 Compare July 24, 2025 16:38
Copy link

ack-prow bot commented Jul 24, 2025

@rushmash91: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
rds-verify-attribution c7c7d15 link false /test rds-verify-attribution

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@knottnt
Copy link
Contributor

knottnt commented Jul 24, 2025

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2025
Copy link

ack-prow bot commented Jul 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knottnt, rushmash91

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit 9c5bb2f into aws-controllers-k8s:main Jul 24, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unable to set some parameters in the DbClusterParameterGroup
2 participants